package datastructure.tree;

/**
 *
 * @author Lei Zhang
 */
public class TreeNode {

    int value = 0;
    boolean isVisited = false;
    TreeNode left = null;
    TreeNode right = null;
    TreeNode nextRight = null;
    TreeNode parent = null;

    public TreeNode(int value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }

    public void setNextRight(TreeNode n) {
        nextRight = n;
    }

    public void setLeftNode(TreeNode p) {
        left = p;
    }

    public void setRightNode(TreeNode p) {
        right = p;
    }

    public void setVisited() {
        isVisited = true;
    }
}
